#ifndef TASK_HPP
#define TASK_HPP
#include <functional>
#include <iostream>
using namespace std;

//直接使用函数指针
//using Task = function<void()>;

//使用仿函数
class Task
{
public:
    //无参构造，用于消费者创建接收数据
    Task()
    {}

    //Task(int x = 0, int y = 0)
    Task(int x, int y)
        :_x(x), _y(y)
    {}

    ~Task()
    {}

    void toDebugQuestion()
    {
        cout << _x << " + " << _y << " =?" << endl;
    }

    void toDebugAnswer()
    {
        cout << _x << " + " << _y << " = " << _x + _y << endl;
    }

private:
    int _x;
    int _y;
    int _sum;
};

#endif